package com.ln.lnzw.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;

import com.blankj.utilcode.util.ActivityUtils;
import com.ln.lnzw.MainActivity;
import com.ln.lnzw.R;
import com.ln.lnzw.app.AppConstant;
import com.ln.lnzw.base.BaseActivity;

/**
 * Created by wuwei on 2018/4/26.
 * 欢迎页面
 */

public class SplashActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_guide);

//         判断是否是第一次开启应用
//        boolean isFirstOpen = spUtils.getBoolean(AppConstant.FIRST_OPEN,false);
////         如果是第一次启动，则先进入功能引导页
//        if (!isFirstOpen) {
//            Intent intent = new Intent(this, WelcomeGuideActivity.class);
//            startActivity(intent);
//            finish();
//            return;
//        }

        // 如果不是第一次启动app，则正常显示启动屏
        setContentView(R.layout.activity_splash);

        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                ActivityUtils.startActivity(activity, MainActivity.class);
                finish();
            }
        }, 3000);

    }
}
